package com.woniu.woniuproject.web;

import com.woniu.woniuproject.entity.Product;
import com.woniu.woniuproject.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 功能描述:<br>
 * 〈〉
 *
 * @author EDZ
 * @create 2020/11/20
 * @since 1.0.0
 */
@RestController
@RequestMapping("pro")
public class ProductWEBController {

    @Autowired
    ProductMapper productMapper;

    @RequestMapping("/go")
    public Integer queryuser(int id,HttpServletRequest req){
       // User userLogin =(User) req.getSession().getAttribute("loginUser");
       // if(userLogin!=null){
            return id;
       // }else{
       //     return "redirect:/login.html";
       // }
    }

    @RequestMapping("/queryall")
    public Product queryall(int id){
        Product product = productMapper.selectByPrimaryKey(id);
        System.out.println(product);
        return product;
    }

}